
public class Solution {

	public static void main(String[] args) {
		Solution so = new Solution();
		int k = 23;
		int m = 10;
		int n = 99;
		int ans = so.mod2(k, m, n);
		System.out.println(ans);
	}

	public int mod2(int k, int m, int n) {
		int count = 0;
		for (int i = m; i <= n; i++) {
			if (mod2(i + k) == mod2(i) + mod2(k)) {
				count++;
			}
		}
		return count;
	}

	public int mod2(int target) {
		int ans = 0;
		int move = 0;
		while (target > 0) {
			int cur = target % 10;
			int mod = cur % 2;
			if (mod == 1) {
				ans |= 1 << move;
			}
			move++;
			target /= 10;
		}
		return ans;
	}

}
